﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace DoNet.FrameWork.DomainModel
{
    /// <summary>
    /// 可以持久到数据库的业务类都要继承的基类
    /// </summary>
    public abstract class Entity : BaseObject
    {
        public Entity()
        {
            Id = Guid.NewGuid();
            SysCreatedOn = DateTime.Now;
            SysModifiedOn = DateTime.Now;
            IsDeleted = false;
        }

        [Key]
        public Guid Id { get; set; }

        public bool IsDeleted { get; set; }

        public Guid SysCreatedBy { get; set; }

        public DateTime SysCreatedOn { get; set; }

        public Guid? SysModifiedBy { get; set; }

        public DateTime? SysModifiedOn { get; set; }
    }
}
